package stark.app.function.more;

import android.content.Intent;

import com.stark.more.CommonMoreInfoActivity;
import com.stark.more.MoreEntry;

import stark.app.R;
import stark.app.databinding.ActivityMoreDemoBinding;
import stark.common.basic.base.BaseNoModelActivity;

/**
 * Author：daizhongbin on 2021/3/29
 * Email：1027154338@qq.com
 * Desc:
 */
public class MoreDemoActivity extends BaseNoModelActivity<ActivityMoreDemoBinding> {

    @Override
    protected int onCreate() {
        return R.layout.activity_more_demo;
    }

    @Override
    protected void initView() {
        mDataBinding.btnMoreCommon.setOnClickListener(v -> {
            MoreEntry.startCommon(this);
        });

        mDataBinding.btnMoreCommon1.setOnClickListener(v -> {
            final String URL = "https://www.baidu.com";
            CommonMoreInfoActivity.Config.Builder builder = new CommonMoreInfoActivity.Config.Builder();
            CommonMoreInfoActivity.Config config = builder.showImg(false)
                    .urlPrivacy(URL)
                    .urlTerms(URL)
                    .rightImgId(R.drawable.ic_baseline_arrow_forward_24)
                    .build();
            MoreEntry.startCommon(this, config);
        });

        mDataBinding.btnMoreCommon2.setOnClickListener(v -> {
            MoreEntry.startSubCommon(this, SubCommonMoreInfoActivity.class, null);
        });

        mDataBinding.btnMoreCommon3.setOnClickListener(v -> {
            MoreEntry.startSubCommon(this, SubCommonMoreInfo2Activity.class, null);
        });

        mDataBinding.btnSubMore.setOnClickListener(v -> {
            Intent intent = new Intent(this, SubMoreInfoActivity.class);
            startActivity(intent);
        });

        mDataBinding.btnAboutDef.setOnClickListener(v -> {
            MoreEntry.startAbout(this);
        });
        mDataBinding.btnAboutCustom.setOnClickListener(v -> {
            startActivity(CustomAboutActivity.class);
        });
    }

    @Override
    protected void initData() {

    }
}
